<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father {
            width: 200px;
            height: 200px;
            background-color: rgb(45, 43, 43);
        }
        .son {
            width: 100px;
            height: 100px;
            background-color: rgb(124, 122, 122);
            position: absolute;
            margin-top: 50px;
            margin-left: 50px;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son"></div>
    </div>
</body>
<script>
    let father = document.querySelector(".father");
    let son = document.querySelector(".son");
    //第三个参数为空或false， 为冒泡传递，从内向外传播事件流
    /*father.addEventListener('click', function(){
        alert('father');
    });
    son.addEventListener('click', function(){
        alert('son');
    })*/
    //否则为捕获过程
    father.addEventListener('click', function(){
        alert('father');
    }, true);
    son.addEventListener('click', function(){
        alert('son');
    }, true);
</script>
</html>